﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="IndagateResultInput.aspx.cs"
    Inherits="ZX.WebApp.TR.IndagateResultInput" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <!--CSS file (default YUI Sam Skin) -->
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/container/assets/skins/sam/container.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/menu/assets/skins/sam/menu.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/button/assets/skins/sam/button.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/resize/assets/skins/sam/resize.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/layout/assets/skins/sam/layout.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/yui_2.9.0/build/datatable/assets/skins/sam/datatable.css" />
    <link href="../Scripts/yui_2.9.0/build/treeview/assets/treeview-core.css" rel="stylesheet"
        type="text/css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/fonts/fonts-min.css" />
    <link rel="stylesheet" type="text/css" href="../scripts/yui_2.9.0/build/treeview/assets/skins/sam/treeview.css" />
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/yahoo-dom-event/yahoo-dom-event.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/element/element-min.js"></script>
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datasource/datasource-min.js"></script>
    <!-- OPTIONAL: JSON Utility (for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/json/json-min.js"></script>
    <!-- OPTIONAL: Connection Manager (enables XHR for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/connection/connection-min.js"></script>
    <!-- OPTIONAL: Get Utility (enables dynamic script nodes for DataSource) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/get/get-min.js"></script>
    <!-- OPTIONAL: Drag Drop (enables resizeable or reorderable columns) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/dragdrop/dragdrop-min.js"></script>
    <!-- OPTIONAL: Calendar (enables calendar editors) -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/calendar/calendar-min.js"></script>
    <!-- Source files -->
    <script type="text/javascript" src="../Scripts/yui_2.9.0/build/datatable/datatable-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/layout/layout-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/button/button-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/container/container-min.js"></script>
    <script type="text/javascript" src="../scripts/yui_2.9.0/build/treeview/treeview-min.js"></script>
    <script src="../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <style type="text/css">
        body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
        /* Table样式 */
        .tableContent
        {
            width:100%;
            border-collapse: collapse;
        }
        .tableContent th
        {
            font-weight:normal;
            border: solid 1px #D4DBE2;
            background-color:#F2F8FF;
            white-space: nowrap;
            line-height:20px;
            text-align:center;
        }
        .tableContent td
        {
            border: solid 1px #D4DBE2;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width: 100%" class="tableContent">
            <tr>
                <th colspan="4">
                    调研结果录入
                </th>
            </tr>
            <tr>
                <td colspan="4">
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td align="right">
                    调研类型：
                </td>
                <td class="style3">
                    &nbsp;<asp:Label ID="lblType" runat="server"></asp:Label>
                </td>
                <td align="right">
                    调研主题：
                </td>
                <td>
                    &nbsp;<asp:Label ID="lblTopic" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    调研内容：
                </td>
                <td class="style3">
                    &nbsp;<asp:Label ID="lblContent" runat="server"></asp:Label>
                </td>
                <td align="right">
                    活动名称：
                </td>
                <td class="style3">
                    &nbsp;<asp:Label ID="lblAName" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    问卷名称：
                </td>
                <td class="style3">
                    &nbsp;<asp:Label ID="lblQName" runat="server"></asp:Label>
                </td>
                <td align="right">
                    问卷目的：
                </td>
                <td class="style3">
                    &nbsp;<asp:Label ID="lblQaim" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td align="right">
                    题目列表：
                </td>
                <td align="left" colspan="3">
                    <asp:Repeater ID="rpList" runat="server">
                        <HeaderTemplate>
                            <table style="width: 100%">
                        </HeaderTemplate>
                        <ItemTemplate>
                            <tr>
                                <td align="right" style="width:120px">
                                    <%#Eval("Sequence")%>、(<%#Eval("SubjectPoint") + "分"%>)
                                </td>
                                <td>
                                    <%#Eval("SubjectName") %>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    &nbsp;
                                </td>
                                <td>
                                    <%#Eval("SubjectContent") %>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    参考答案：
                                </td>
                                <td>
                                    <%#Eval("RefAnswer")%>
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    您的答案：
                                </td>
                                <td>
                                    <textarea id="txtAnswer" style="width:250px; height:50px"><%#Eval("Answer")%></textarea>
                                    <input type="hidden" id="SubID" value='<%#Eval("TrSubjectInfoID")%>' />
                                </td>
                            </tr>
                            <tr>
                                <td align="right">
                                    得分：
                                </td>
                                <td>
                                    <input id="txtSubjectPoint" type="text" value='<%#Eval("Point") %>' style="width:250px;" />
                                </td>
                            </tr>
                            <tr>
                                <td colspan="2">
                                    &nbsp;
                                </td>
                            </tr>
                        </ItemTemplate>
                        <FooterTemplate>
                            </table>
                        </FooterTemplate>
                    </asp:Repeater>
                </td>
            </tr>
            <tr>
                <td align="right">
                    总得分：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtPoint" runat="server" Width="375"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td align="right">
                    调研总结：
                </td>
                <td colspan="3">
                    <asp:TextBox ID="txtResult" runat="server" TextMode="MultiLine" 
                            Width="375" Height="80"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>&nbsp;</td>
                <td colspan="3">
                    <button type="button" id="btnSave" name="btnSave" onclick="return Save()">保存</button> 
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
<script type="text/javascript">
    function Save() {
        var IndaagteID = "<%=strIndagateId %>";
        var SubID = "";
        $('input[id="SubID"]').each(function () {
            SubID = SubID + "," + $(this).val();
        });
        var Answer = "";
        $('textarea[id="txtAnswer"]').each(function () {
            Answer = Answer + "#" + $(this).val();
        });
        var Point = "";
        $('input[id="txtSubjectPoint"]').each(function () {
            Point = Point + "#" + $(this).val();
        });
        var SumPoint = $("#txtPoint").val();
        var Result = $("#txtResult").val();


        var url = "../Extend/AjaxData/DataProcessin.aspx?action=Update&entity=TrIndagateSubject&id=" + IndaagteID + "&ids=" + SubID + "&answer=" + encodeURI(Answer) + "&point=" + Point + "&sumpoint=" + SumPoint + "&result=" + encodeURI(Result) + "";
        YAHOO.util.Connect.asyncRequest('POST', url, {
            success: function (res) {
                var inventory;
                try {
                    inventory = JSON.parse(res.responseText);
                    if (inventory == 1) {
                        alert("保存成功!");
                        parent.closeWin();
                    } else {
                        alert("保存失败!");
                    }
                }
                catch (e) {
                }
                finally {
                }
            },
            failure: function (error) {
                alert("读取菜单数据错误：" + error.statusText);
            }
        }, null);
    }
</script>
</html>
